package com.uinnova.product.eam;

import com.uino.init.UinoLicenseAuthorityFilter;
import com.uino.init.UinoLicenseConfiguration;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;

@ImportResource(locations={"classpath:spring-context.xml"})
@SpringBootApplication
@Configuration
@EnableScheduling
@ServletComponentScan("com.uino.init")
@ComponentScan(
        basePackages = {
                "com.uinnova.product.eam.feign.server.config",
                "com.uinnova.product.vmdb.client", "com.uinnova.product.es",
                "com.uinnova.product.base.client", "com.uinnova.product.cmdb.client",
                "com.uinnova.product.eam.web",
                "com.uinnova.product.eam.config",
                "com.uinnova.product.eam.init",
                "com.uino.init", "com.uino.service.init", "com.uino.oauth2", "com.uino.oauth.common","com.uino.common.es"},
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.REGEX, pattern = {"com.uino.web.license.*","com.uino.common.es.license.*"}),
                @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {UinoLicenseAuthorityFilter.class, UinoLicenseConfiguration.class})})
@EnableFeignClients(basePackages = { "com.uino.tarsier.primarykey.client",
        "com.uinnova.product.vmdb.client", "com.uinnova.product.es", "com.uinnova.product.base.client",
        "com.uinnova.product.cmdb.client"})
@Slf4j
public class EamDockerApplication {

    static {
        log.info("开始加载eam-web模块");
    }

    public static void main(String[] args) {
        SpringApplication.run(EamDockerApplication.class, args);
    }
}
